﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml.Linq;
using Microsoft.SharePoint;
using System.Text.RegularExpressions;

namespace LizardSoft.Common.FlexibleStructureDeployment
{
    public static partial class StructureHelper
    {
        private static void DoActionIfNeeded(string siteUrl, string webStrUrl, ListProcessingInfo listProcessingInfo, Action<SPWeb, ListProcessingInfo> action)
        {
            if (action != null)
            {
                SPSite site = null;
                SPWeb web = null;
                try
                {
                    site = new SPSite(siteUrl);
                    web = site.OpenWeb(webStrUrl);
                    action(web, listProcessingInfo);
                }
                catch { throw; }
                finally
                {
                    web.Dispose();
                    site.Dispose();
                }
            }
        }
    }
}
